
<div class="titlebar">
    <div class="fn-right">
        <form class="input-group" id="form" action="{:url('info.order/index')}" method="get">
            <input type="hidden" name="types" value="{$types}">
            <input type="hidden" name="time" value="{$time}">
            <input type="hidden" name="infoid" value="{$infoid}">
            <input placeholder="开始时间" class="input w100 ui-date" type="text" name="starttime" value="{$starttime}" autocomplete="off"/>
            <input placeholder="结束时间" class="input w100 ui-date" type="text" name="endtime" value="{$endtime}" autocomplete="off"/>
            <input placeholder="手机号码" class="input w200" type="text" name="keyword" value="{$keyword}"/>
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
    <div class="fn-right button-group">
        <a href="{:url('info.order/index',['time' => 1,'types' =>$types,'infoid' => $infoid])}" class="button{$time==1?' button-violet':''}">今日</a>
        <a href="{:url('info.order/index',['time' => 2,'types' =>$types,'infoid' => $infoid])}" class="button{$time==2?' button-violet':''}">昨日</a>
        <a href="{:url('info.order/index',['time' => 30,'types' =>$types,'infoid' => $infoid])}" class="button{$time==30?' button-violet':''}">本月</a>
        <a href="{:url('info.order/index',['time' => 60,'types' =>$types,'infoid' => $infoid])}" class="button{$time==60?' button-violet':''}">上月</a>
    </div>
    <div class="fn-left">
        <a href="{:url('info.order/index',['types' =>'1','time' => $time,'infoid' => $infoid])}" class="button {if $types == '1'} button-green{/if}">待核销</a>
        <a href="{:url('info.order/index',['types' =>'2','time' => $time,'infoid' => $infoid])}" class="button {if $types == '2'} button-green{/if}">已核销</a>
        <a href="{:url('info.order/index',['types' =>'0','time' => $time,'infoid' => $infoid])}" class="button {if $types == '0'} button-green{/if}">未付款</a>
    </div>
</div>
<div class="cards">
    <div class="card yellow">
        <div class="fn-left"><i class="iconfont icon-renminbi1688"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$pay|money}</div><div class="text">已支付</div></div>
    </div>
    <div class="card">
        <div class="fn-left"><i class="iconfont icon-renminbi1688"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$invalid|money}</div><div class="text">已核销</div></div>
    </div>
</div>
<table class="pure-table">
    <thead>
    <tr>
        <th class="w200">用户名</th>
        <th>订单号</th>
        <th class="w100 fn-tac">手机号</th>
        <th class="w100 fn-tac">价格</th>
        <th class="w100 fn-tac">核销/状态</th>
        <th class="w140">发布时间</th>
        <th class="w100 fn-tac">操作</th>
    </tr>
    </thead>
    <tbody>
    {foreach $lists as $vo}
    <tr>
        <td><a href="javascript:;" url="{:url('system/passport.user/review',['uid' => $vo.uid])}" class="win">{$vo.user.nickname}</a></td>
        <td><a href="javascript::" url="{:url('info.order/detail',['id' => $vo.id])}" class="win">{$vo.order_no}</a></td>
        <td class="fn-tac">{$vo.phone}</td>
        <td class="fn-tac">{$vo.amount|money}</td>
        <td class="fn-tac">
            <a class="isLock" attr='{$vo.status}' url="{:url('info.order/completion',['id'=>$vo.id,'status' => $vo.status])}" href="javascript:;" title="核销">
                {if $vo.paid_at == 1 && $vo.status == 0}<span class="badge bg-red">待核销</span>
                {elseif $vo.paid_at == 1 && $vo.status == 1 /}<span class="badge bg-green">已核销</span>
                {else /}<span class="badge">未付款</span>{/if}
            </a>
        </td>
        <td>{$vo.create_time|date='Y-m-d H:i'}</td>
        <td class="fn-tac">
            {if $vo.paid_at == 1}
                <span class="button button-disabled"><i class="iconfont icon-lajixiang"></i>删除</span>
            {else}
            <a class="button isDel" url="{:url('info.order/delete',['id'=>$vo.id,'status' => $vo.status])}" href="javascript:;" title="删除"><i class="iconfont icon-lajixiang"></i>删除</a>
            {/if}
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
    Do('base','form','layer','tip','date', function () {
        $('#form').isForm({types:1});
        $('.isDel').isDel();
        $('.win').win();
        $('.isLock').click(function () {
            if($(this).attr("attr")  == 1 || !parseInt('{$types}')){
                return false;
            }
            var url = $(this).attr("url");
            parent.layer.confirm('确认要直接核销?',{ icon: 3,title: '友情提示' }, function (index) {
                $.getJSON(url, function (data) {window.location.reload();});
                parent.layer.close(index);
            });
        })
    })
</script>